package com.mf.cloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * ClassName: RestTemplateConfig
 * Package: com.mf.cloud.config
 *
 * @Author: lmf
 * @Create: 2024/3/10 11:41
 * @Version: 1.0
 * Description:  微服务相互访问配置
 */
@Configuration // 声明为配置类
public class RestTemplateConfig {
    @Bean
    @LoadBalanced// 开启负载均衡功能
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
